package com.world.config;

import com.world.common.filter.AuthenticationFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;

import javax.annotation.Resource;

/**
 * 过滤器配置
 *
 * @author WangYX
 * @version 1.0.0
 * @date 2023/06/01 14:38
 */
@Configuration
public class FilterConfig {



    /**
     * 认证过滤器
     *
     * @return {@link FilterRegistrationBean}
     * @author WangYX
     * @date 2023/08/29 12:24
     */
    @Bean
    @SuppressWarnings({"rawtypes", "unchecked"})
    public FilterRegistrationBean registrationAuthenticationFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new AuthenticationFilter());
        registration.addUrlPatterns("/*");
        registration.setOrder(1);
        return registration;
    }

}
